package com.lch.designpattern.combination;

/**
 * @author: liuchenhui
 * @create: 2020-03-08 15:26
 **/
public class TestMain {
    public static void main(String[] args) {
        Menu root = new Menu("a");
        Menu root1 = new Menu("b");
        Menu root2 = new Menu("c");
        ChildMenu root3 = new ChildMenu("d", 1);
        ChildMenu root4 = new ChildMenu("e", 2);
        ChildMenu root5 = new ChildMenu("f", 2);

        root5.adChild(root);
        root4.adChild(root1);
        root4.adChild(root2);

        root3.adChild(root4);
        root3.adChild(root5);
        root3.adChild(new Menu("g"));

//        root1.show();
//        root2.show();
        root3.show();
    }
}
